home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
os2
/
adaptor.zip
/
ADAPT.ZIP
/
adaptor
/
examples
/
dalib
/
reduct
/
real.f
< prev
Wrap
Text File
|
1993-03-23
|
922b
|
51 lines
program test
integer k
parameter (k = 3)
real a(k)
a(1) = 7.0
a(2) = 3.0
a(3) = 10.0
call sumtest (a, k, 20.0)
call prodtest (a, k, 210.0)
call mintest (a, k, 3.0)
call maxtest (a, k, 10.0)
end
subroutine sumtest (a, N, result)
real a(n), s, result
s = sum (a)
print *, 'SUM: Result is ', s, ' should be ', result
end
subroutine prodtest (a, N, result)
real a(n), s, result
s = product (a)
print *, 'PRODUCT: Result is ', s, ' should be ', result
end
subroutine mintest (a, N, result)
real a(n), s, result
s = minval (a)
print *, 'MINVAL: Result is ', s, ' should be ', result
end
subroutine maxtest (a, N, result)
real a(n), s, result
s = maxval (a)
print *, 'MAXVAL: Result is ', s, ' should be ', result
end